package chapter11;

/**
 * Created by V5470-I5 on 2016/4/11.
 */
import static java.lang.System.out;
public class JoinDemo {
    public static void main(String[] args) throws InterruptedException{
        out.println("Main thread 开始...");
        Thread threadB=new Thread(()->{

            out.println("Thread B开始...");
            for (int i=0;i<5;i++){
                out.println("Thread B执行...");
            }
            out.println("Thread B将结束...");
        });
        threadB.start();
        threadB.join();
        out.println("Main thread将结束...");
    }
}
